/** @file
 *
 * Definitions for recent "preference" handling routines
 * Copyright 2004, Ulf Lamping <ulf.lamping@web.de>
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef __RECENT_H__
#define __RECENT_H__

#include <stdio.h>
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/** @file
 *  Recent user interface settings.
 *  @ingroup main_window_group
 */

typedef struct _col_width_data {
    int    width;
    char   xalign;
} col_width_data;

/** Defines used in col_width_data.xalign */
#define COLUMN_XALIGN_DEFAULT  0
#define COLUMN_XALIGN_LEFT    'L'
#define COLUMN_XALIGN_CENTER  'C'
#define COLUMN_XALIGN_RIGHT   'R'

typedef enum {
    BYTES_HEX,
    BYTES_BITS,
    BYTES_DEC,
    BYTES_OCT
} bytes_view_type;

typedef enum {
    BYTES_ENC_FROM_PACKET, // frame_data packet_char_enc
    BYTES_ENC_ASCII,
    BYTES_ENC_EBCDIC
} bytes_encoding_type;

typedef enum {
    SEARCH_IN_PACKET_LIST,
    SEARCH_IN_PACKET_DETAILS,
    SEARCH_IN_PACKET_BYTES
} search_in_type;

typedef enum {
    SEARCH_CHAR_SET_NARROW_AND_WIDE,
    SEARCH_CHAR_SET_NARROW,
    SEARCH_CHAR_SET_WIDE
} search_char_set_type;

typedef enum {
    SEARCH_TYPE_DISPLAY_FILTER,
    SEARCH_TYPE_HEX_VALUE,
    SEARCH_TYPE_STRING,
    SEARCH_TYPE_REGEX
} search_type_type;

typedef enum {
    SHOW_ASCII,
    SHOW_ASCII_CONTROL,
    SHOW_CARRAY,
    SHOW_EBCDIC,
    SHOW_HEXDUMP,
    SHOW_HTML,
    SHOW_IMAGE,
    SHOW_JSON,
    SHOW_RAW,
    SHOW_RUSTARRAY,
    SHOW_CODEC, // Will map to UTF-8 in the combobox (other codecs
                // are generated at runtime).
    SHOW_YAML
} bytes_show_type;

typedef enum {
    FOLLOW_DELTA_NONE,
    FOLLOW_DELTA_TURN,
    FOLLOW_DELTA_ALL
} follow_delta_type;

typedef enum {
    DecodeAsNone,
    DecodeAsBASE64,
    DecodeAsCompressed,
    DecodeAsHexDigits,
    DecodeAsPercentEncoding,
    DecodeAsQuotedPrintable,
    DecodeAsROT13
} bytes_decode_type;

/** Recent settings. */
typedef struct recent_settings_tag {
//    bool        main_toolbar_show;
//    bool        filter_toolbar_show;
//    bool        wireless_toolbar_show;
//    bool        packet_list_show;
//    bool        tree_view_show;
//    bool        byte_view_show;
//    bool        packet_diagram_show;
//    bool        statusbar_show;
//    bool        packet_list_colorize;
//    bool        capture_auto_scroll;
////    ts_type     gui_time_format;
////    int         gui_time_precision;
////    ts_seconds_type gui_seconds_format;
//    int         gui_zoom_level;
    bytes_view_type gui_bytes_view;
    bytes_encoding_type gui_bytes_encoding;
//    bool        gui_packet_diagram_field_values;
    bool        gui_allow_hover_selection;

//    search_in_type  gui_search_in;
//    search_char_set_type gui_search_char_set;
//    bool        gui_search_case_sensitive;
//    bool        gui_search_reverse_dir;
//    bool        gui_search_multiple_occurs;
//    search_type_type gui_search_type;
    bytes_show_type gui_follow_show;
//    follow_delta_type gui_follow_delta;
//    bytes_decode_type gui_show_bytes_decode;
    bytes_show_type gui_show_bytes_show;

//    int         gui_geometry_main_x;
//    int         gui_geometry_main_y;
//    int         gui_geometry_main_width;
//    int         gui_geometry_main_height;

//    bool        gui_geometry_main_maximized;
//    bool        gui_geometry_leftalign_actions;

//    int         gui_geometry_main_upper_pane;
//    int         gui_geometry_main_lower_pane;
//    char       *gui_geometry_main;
//    char       *gui_geometry_main_master_split;
//    char       *gui_geometry_main_extra_split;
//    bool        privs_warn_if_elevated;
//    bool        sys_warn_if_no_capture;
//    GList      *col_width_list;                     /* column widths */
//    GList      *conversation_tabs;                  /* enabled conversation dialog tabs */
//    GList      *conversation_tabs_columns;          /* save the columns for conversation dialogs */
//    GList      *endpoint_tabs;                      /* enabled endpoint dialog tabs */
//    GList      *endpoint_tabs_columns;              /* save the columns for endpoint dialogs */
//    int         gui_profile_switch_check_count;     /* number of packets / events to check for automatic profile switching */
//    char       *gui_fileopen_remembered_dir;        /* folder of last capture loaded in File Open dialog */
//    bool        gui_rlc_use_pdus_from_mac;
//    GList      *custom_colors;
//    GList      *gui_additional_toolbars;
//    GList      *interface_toolbars;
} recent_settings_t;

/** Global recent settings. */
extern recent_settings_t recent;

/** Initialize recent settings module (done at startup) */
extern void recent_init(void);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* recent.h */
